﻿<Window x:Class="TicketServer.ImportWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:eT="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
        xmlns:t="clr-namespace:TicketServer"
        Title="{LocText TicketServer:Import:WindowTitle}"
        Width="655"
        Height="765"
        MinWidth="450"
        MinHeight="700"
        Closing="Window_Closing"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Icon="/TicketServer;component/Icons/Large/txt.png"
        ResizeMode="CanResize"
        ShowInTaskbar="False"
        WindowStartupLocation="CenterOwner"
        WindowStyle="SingleBorderWindow">
	<eT:BusyIndicator x:Name="busyIndicator">
		<eT:BusyIndicator.BusyContentTemplate>
			<DataTemplate>
				<StackPanel Margin="4">
					<TextBlock HorizontalAlignment="Center"
					           FontWeight="Bold"
					           Text="{LocText TicketServer:Import:ImportingTickets}" />
					<StackPanel Margin="4">
						<TextBlock x:Name="textBlockOverlayStatus" Text="{Binding Text, ElementName=textBlockStatus}" />
						<ProgressBar Height="15"
						             Margin="0 5 0 0"
						             Value="{Binding Value,
						                             ElementName=progressBarStatus}" />
					</StackPanel>
				</StackPanel>
			</DataTemplate>
		</eT:BusyIndicator.BusyContentTemplate>
		<eT:BusyIndicator.ProgressBarStyle>
			<Style TargetType="ProgressBar">
				<Setter Property="Visibility" Value="Collapsed" />
			</Style>
		</eT:BusyIndicator.ProgressBarStyle>

		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition />
				<ColumnDefinition />
				<ColumnDefinition Width="34" />
			</Grid.ColumnDefinitions>

			<Grid.RowDefinitions>
				<RowDefinition Height="45" />
				<RowDefinition Height="34" />
				<RowDefinition Height="25" />
				<RowDefinition Height="45" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
				<RowDefinition Height="34" />
			</Grid.RowDefinitions>

			<TextBlock Grid.Row="0"
			           Grid.Column="0"
			           Grid.ColumnSpan="4"
			           Margin="10,3"
			           VerticalAlignment="Bottom"
			           FontSize="14"
			           Text="{LocText TicketServer:Import:ImportDescriptionText}"
			           TextWrapping="Wrap" />

			<TextBlock Grid.Row="1"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockFile}" />
			<TextBox x:Name="textBoxFile"
			         Grid.Row="1"
			         Grid.Column="1"
			         Grid.ColumnSpan="2"
			         Margin="5"
			         TextChanged="textBoxFile_TextChanged" />
			<Button x:Name="buttonBrowse"
			        Grid.Row="1"
			        Grid.Column="3"
			        Margin="5"
			        Click="buttonBrowse_Click"
			        Content="..." />

			<CheckBox x:Name="checkBoxHeader"
			          Grid.Row="2"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="10,0,0,0"
			          VerticalAlignment="Center"
			          Content="{LocText TicketServer:Import:CheckBoxHasHeader}"
			          IsChecked="True" />

			<TextBlock Grid.Row="3"
			           Grid.Column="0"
			           Grid.ColumnSpan="4"
			           Margin="10,3"
			           VerticalAlignment="Bottom"
			           FontSize="14"
			           Text="{LocText TicketServer:Import:ImportColumnText}"
			           TextWrapping="Wrap" />

			<TextBlock Grid.Row="4"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockSeparator}" />
			<ComboBox x:Name="comboBoxSeparator"
			          Grid.Row="4"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEditable="True"
			          IsEnabled="False"
			          TextBoxBase.TextChanged="comboBoxSeparator_TextChanged">
				<ComboBoxItem Content="\t" Selector.IsSelected="True" />
				<ComboBoxItem Content="," />
				<ComboBoxItem Content=";" />
			</ComboBox>

			<TextBlock Grid.Row="5"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockCodeColumn}" />
			<ComboBox x:Name="comboBoxCodeColumn"
			          Grid.Row="5"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEnabled="False"
			          SelectionChanged="comboBoxColumn_SelectionChanged" />

			<TextBlock Grid.Row="6"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockNameColumn}" />
			<ComboBox x:Name="comboBoxNameColumn"
			          Grid.Row="6"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEnabled="False"
			          SelectionChanged="comboBoxColumn_SelectionChanged" />

			<TextBlock Grid.Row="7"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockStreetColumn}" />
			<ComboBox x:Name="comboBoxStreetColumn"
			          Grid.Row="7"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEnabled="False"
			          SelectionChanged="comboBoxColumn_SelectionChanged" />

			<TextBlock Grid.Row="8"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockZipColumn}" />
			<ComboBox x:Name="comboBoxZipColumn"
			          Grid.Row="8"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEnabled="False"
			          SelectionChanged="comboBoxColumn_SelectionChanged" />

			<TextBlock Grid.Row="9"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockCityColumn}" />
			<ComboBox x:Name="comboBoxCityColumn"
			          Grid.Row="9"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEnabled="False"
			          SelectionChanged="comboBoxColumn_SelectionChanged" />

			<TextBlock Grid.Row="10"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockPhoneColumn}" />
			<ComboBox x:Name="comboBoxPhoneColumn"
			          Grid.Row="10"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEnabled="False"
			          SelectionChanged="comboBoxColumn_SelectionChanged" />

			<TextBlock Grid.Row="11"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockMailColumn}" />
			<ComboBox x:Name="comboBoxMailColumn"
			          Grid.Row="11"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5"
			          IsEnabled="False"
			          SelectionChanged="comboBoxColumn_SelectionChanged" />

			<TextBlock Grid.Row="12"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Left"
			           VerticalAlignment="Bottom"
			           Text="{LocText TicketServer:Import:TextBlockPreview}" />

			<ListView x:Name="listViewPreview"
			          Grid.Row="13"
			          Grid.Column="0"
			          Grid.ColumnSpan="4"
			          Margin="5" />

			<TextBlock Grid.Row="14"
			           Grid.Column="0"
			           Grid.ColumnSpan="4"
			           Margin="10,3"
			           VerticalAlignment="Bottom"
			           FontSize="14"
			           Text="{LocText TicketServer:Import:ImportTypeText}"
			           TextWrapping="Wrap" />

			<TextBlock Grid.Row="15"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockTicketMode}" />
			<ComboBox x:Name="comboBoxTicketMode"
			          Grid.Row="15"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5">
				<t:IsOnlineComboBoxItem Content="{LocText TicketServer:Import:ItemOfflineTicket}"
				                        IsOnlineTicket="False"
				                        IsSelected="True" />
				<t:IsOnlineComboBoxItem Content="{LocText TicketServer:Import:ItemOnlineTicket}" IsOnlineTicket="True" />
			</ComboBox>

			<TextBlock Grid.Row="16"
			           Grid.Column="0"
			           Margin="5"
			           HorizontalAlignment="Right"
			           VerticalAlignment="Center"
			           Text="{LocText TicketServer:Import:TextBlockTicketType}" />
			<ComboBox x:Name="comboBoxTicketType"
			          Grid.Row="16"
			          Grid.Column="1"
			          Grid.ColumnSpan="2"
			          Margin="5">
				<t:TicketTypeComboBoxItem Content="{LocText TicketServer:Import:ItemNormalTicket}"
				                          IsSelected="True"
				                          TicketType="Normal" />
				<t:TicketTypeComboBoxItem Content="{LocText TicketServer:Import:ItemFreeTicket}" TicketType="Free" />
				<t:TicketTypeComboBoxItem Content="{LocText TicketServer:Import:ItemSpecialTicket}" TicketType="Special" />
			</ComboBox>

			<Button x:Name="buttonImport"
			        Grid.Row="17"
			        Grid.Column="0"
			        Grid.ColumnSpan="4"
			        Width="180"
			        Margin="5"
			        Click="buttonImport_Click"
			        Content="{LocText TicketServer:Import:ButtonImport}"
			        IsEnabled="False" />

			<StatusBar Grid.Row="18"
			           Grid.Column="0"
			           Grid.ColumnSpan="4"
			           Margin="0,10,0,0"
			           BorderBrush="Gray"
			           BorderThickness="0 1 0 0">
				<StatusBar.ItemsPanel>
					<ItemsPanelTemplate>
						<Grid Margin="0">
							<Grid.RowDefinitions>
								<RowDefinition Height="*" />
							</Grid.RowDefinitions>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="Auto" />
							</Grid.ColumnDefinitions>
						</Grid>
					</ItemsPanelTemplate>
				</StatusBar.ItemsPanel>

				<StatusBarItem>
					<TextBlock x:Name="textBlockStatus" Text="{LocText TicketServer:Import:ImportStatusReady}" />
				</StatusBarItem>
				<StatusBarItem Grid.Column="1">
					<ProgressBar x:Name="progressBarStatus"
					             Width="100"
					             Height="15"
					             Visibility="Hidden"
					             Value="0" />
				</StatusBarItem>
			</StatusBar>
		</Grid>
	</eT:BusyIndicator>
</Window>
